import request from '@/utils/request';

//请求用户选择数据
export const getDataApi = async (params: any) => {
  const res = await request('/accountSelector/findUser', {
    method: 'POST',
    data: params,
    serviceId: 'fwSecurity',
  });
  const content = (res || []) as { id: string; userId: string }[];
  const listUsers = content.map((user) => ({
    ...user,
    combineLabel: user.userName + '-' + user.userLoginName,
    id: user.userId.toString(), // 兼容 Selector 的value不支持number格式
  }));
  return listUsers;
};
